#include "Arm.h"
#include "Render/Shader.h"
#include "Core/Application.h"
#include "Render/Render.h"
#include "Character.h"

Arm::Arm()
{
	shader_arm = new Shader("assets/shaders/body.vs", "assets/shaders/body.frag");
}

Arm::~Arm()
{
}

void Arm::RenderActor()
{
	Super::RenderActor();

	Camera* camera = ((Character*)Root)->GetCamera();
	glm::mat4 projection = camera->GetProjectionMatrix(camera->Zoom, (float)Application::Get().GetWindow().GetWidth() / (float)Application::Get().GetWindow().GetHeight(), 0.1f, 1000.0f);
	glm::mat4 view = camera->GetViewMatrix();
	glm::mat4 model = glm::mat4(1.0f);

	shader_arm->use();
	shader_arm->setMat4("projection", projection);
	shader_arm->setMat4("view", view);
	shader_arm->setVec3("bodyColor", glm::vec3(1.0f, 1.0f, 0.0f));

	model = GetTransformMatrix();
	shader_arm->setMat4("model", model);
	Render::renderCube();
}
